package com.raymond.service.impl;

import com.raymond.mapper.UserMapper;
import com.raymond.pojo.User;
import com.raymond.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: java类作用描述
 * @Author: yc
 * @CreateDate: 2019/2/18$ 16:43$
 * @Version: 1.0
 */
@Service
public class UserService implements IUserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public int insert(User record) {
        return userMapper.insert(record);
    }

    @Override
    public Boolean insertSelective(User record) {
        if(userMapper.insertSelective(record)>0){
            return true;
        }
        return false;
    }

    @Override
    public List<User> findUser() {
        return userMapper.findUser();
    }

    @Override
    public User getUser(String name) {
        return userMapper.getUser(name);
    }

    @Override
    public User login(User user) {
        return userMapper.login(user.getName(),user.getPassword());
    }
}
